<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>注册</title>
<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<style type="text/css">
	div{
	 width:300px;
	 border: 1px solid red;
	 margin: 20px auto;
	 padding: 20px;
	}
</style>
<script type="text/javascript">
	function getCode(){
		
		$.post('SmsServlet','phone='+$('#phone').val(),function(data){
			console.log(data);
			if("1" == data){
				alert('短信已发出');
			} else {
				alert('无法发送短信');
			}
		})
	}
</script>
</head>
<body>

	<div>
		<h2>普通注册</h2>
		<form action="RegisterByUsernameServlet" method="post">
			用户名：<input type="text" name="login_name" />
			<br/>
			密码：<input type="password" name="password" />
			<br/>
			<input type="submit" value="提交"/>
		</form>
	</div>
	
	<div>
		<h2>邮箱注册</h2>
		<form action="RegisterByEmailServlet" method="post">
			用户名：<input type="text" name="login_name" />
			<br/>
			Email：<input type="text" name="email" />
			<br/>
			密码：<input type="password" name="password" />
			<br/>
			<input type="submit" value="提交"/>
		</form>
	</div>


	<div>
		<h2>手机注册</h2>
		<form action="RegisterByPhoneServlet" method="post">
			用户名：<input type="text" name="login_name" />
			<br/>
			手机号：<input type="text" name="phone" id="phone"/>
			<br/>
			验证码：<input type="text" name="code" /> <input type="button" value="获取验证码" onclick="getCode();" />
			<br/>
			密码：<input type="password" name="password" />
			<br/>
			<input type="submit" value="提交"/>
		</form>
	</div>
</body>
</html>